<template>
<view>
<view class="news-details">
<!--    <view class="header">
        <view class="title xxl m-b-20">{{ articleDetail.title }}</view>
        <view class="flex row-between">
            <view class="xs lighter">发布时间：{{ articleDetail.create_time }}</view>
            <view class="flex">
                <image class="icon-sm" src=""></image>
                <view class="m-l-10 xs muted">{{ articleDetail.visit }}人浏览</view>
            </view>
        </view>
    </view> -->
	<view class="rule" @click="apifun.navigate('/bundle/pages/rule?fuli='+fuli)">规则</view>
    <view class="main">
        <u-parse :html="article_content" />
    </view>
	<view class="xxx" v-for="(item,index) in articleDetail" @click="apifun.navigate(item.link)">
		<image :src="item.image" mode=""></image>
	</view>
</view>
<loading-view v-if="showLoading"></loading-view>
</view>
</template>

<script>
	import {
		getArticleDetail,
		userdetail
	} from '@/api/store'
	export default {
		data() {
			return {
				showLoading: true,
				articleDetail: {},
				article_content: "",
				type: "",
				fuli:"",
			};
		},

		onLoad(option) {
			this.type = option.type
			this.getData()
		},
		methods: {
			async getData() {
				if(this.type==3){
					uni.setNavigationBarTitle({
						title: '会员专属礼券'
					});
				}if(this.type==4){
					uni.setNavigationBarTitle({
						title: '积分兑换'
					});
				}if(this.type==5){
					uni.setNavigationBarTitle({
						title: '一对一客服'
					});
				}if(this.type==6){
					uni.setNavigationBarTitle({
						title: '专享福利活动'
					});
				}
				const res = await userdetail()
				this.articleDetail = res.data.list
				this.fuli = res.data.fuli_info.content
				console.log('11',this.fuli)
				setTimeout(() => {
				  this.article_content = res.data.content;
				}, 200);
				setTimeout(() => {
				    this.showLoading = false
				}, 300);
			},
		}
	};
</script>
<style lang="scss">
page {
    background-color: #fff;
}
.rule{
	position: absolute;
	top: 440rpx;
	right: 0;
	background-color: #f1cca6;
	font-size: 30rpx;
	padding: 4rpx 16rpx 2rpx 26rpx;
	border-radius: 50rpx 0 0 50rpx;
	color: #8d441f;
	z-index: 2;
}
.news-details .header{
    padding: 20rpx 15px;
    border-bottom: $-solid-border;
}
.news-details .main {
    padding: 40rpx 15px;
	margin: 0 10rpx;
	z-index: -1; 
}
image{
	width: 92%;
	height: 140rpx;
	// margin: 0 auto;
	margin-left: 28rpx;
	padding-bottom: 30rpx;
}
</style>
